"""
@File    :   no_introduction.py
@Time    :   2024/03/28 22:25:23
@Author  :   Qrj
@Email   :   923207736@qq.com
@description   :   无需引入其他依赖(全局的no_introduction.py下的依赖项不包含在内)的依赖
"""

from typing import Annotated

from fastapi import Body, Query


class GetUserIdDependencies:
    """获取用户ID的依赖类"""

    @staticmethod
    async def from_body(
        user_id: Annotated[int, Body(..., ge=1, description="用户ID")],
    ) -> int:
        """从json获取"""
        return user_id

    @staticmethod
    async def from_query(
        user_id: Annotated[int, Query(..., ge=1, description="用户ID")],
    ) -> int:
        """从query获取"""
        return user_id
